package cn.waxcc.controller;

import cn.waxcc.pojo.HrsPatientRegistration;
import cn.waxcc.service.HrsPatientRegistrationService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 功能说明
 *
 * @author HZ
 * @date 2023-04-11 18:54:23
 */
@RestController
@RequestMapping("/pat")
public class HrsPatientRegistrationController {
    @Autowired
    private HrsPatientRegistrationService hrsPatientRegistrationService;

    //查询
    @RequestMapping("/all")
    public List<HrsPatientRegistration> all() {
        List<HrsPatientRegistration> hrsPatientRegistrations = hrsPatientRegistrationService.queryallPatient();
        return hrsPatientRegistrations;
    }

    //新增
    @RequestMapping("/ins")
    public void insPatient( @RequestBody HrsPatientRegistration hrsPatientRegistration) {
        System.out.println(hrsPatientRegistration);
        System.out.println("新增进来了");
        hrsPatientRegistrationService.insPatient(hrsPatientRegistration);
    }

    //搜索查询
    @RequestMapping("/search")
    public List<HrsPatientRegistration> BySearchPatient(String pName, String pStatusid, String pPhone) {
        List<HrsPatientRegistration> hrsPatientRegistrations = hrsPatientRegistrationService.BySearchPatient(pName, pStatusid, pPhone);
        return hrsPatientRegistrations;
    }
}
